2: COMMENT ⊗ VALID 00022 PAGES 3: C REC PAGE DESCRIPTION 4: C00001 00001 5: C00003 00002 BEGIN MTCSER ↔ SUBTTL MTCSER - MAGNETIC TAPE ROUTINES FOR PDP-6(516) 6: C00005 00003 MTC CONO BITS: 7: C00008 00004 MAG TAPE SERVICE DISPATCH 8: C00009 00005 MTAPE UUO 9: C00014 00006 IS SYSTEM AVAILABLE 10: C00018 00007 MTAPE 0 WAITS UNTIL THE CONTROL IS FREE 11: C00020 00008 ROUTINE TO SEE IF UNIT IS REWINDING 12: C00023 00009 READ AND WRITE 13: C00026 00010 CLOSE OUTPUT 14: C00028 00011 INTERRUPTS FROM MAG TAPE CONTROL ARE SENT HERE FROM IOINIT 15: C00031 00012 MTPDUN: AOS MTCBKN(DDB) COUNT NR. OF BLOCKS READ OR WRITTEN FOR THIS DRIVE 16: C00033 00013 MTEND1: CONO DC,0 TURN OFF DATA CONTROL 17: C00035 00014 MTNIO1: CONO MTS,0 CLEAR MAG TAPE ENABLES. 18: C00038 00015 ROUTINE CALLED AT CLOCK LEVEL TO SEE IF ANY UNITS WHICH ARE IN A 19: C00040 00016 MTNOTI: PUSHJ P,ADVBFE WRITING 20: C00041 00017 MTEOR2: SKIPE MTEOFF END-OF-FILE? 21: C00044 00018 THIS ROUTINE BACKSPACES OVER ONE RECORD (A BAD ONE) THEN 22: C00047 00019 LOGICAL END OF TAPE LOOP 23: C00048 00020 DEVICE DEPENDENT DUMP MODES. MODE 16. 24: C00051 00021 MTDPI1: TRNE IOS,IODEND EOF? 25: C00052 00022 MDRTRY: MOVE TAC,@MTCMDP RETRY LAST OPERATION 26: C00054 ENDMK 27: C⊗; 29: BEGIN MTCSER ↔ SUBTTL MTCSER - MAGNETIC TAPE ROUTINES FOR PDP-6(516) 30: ; 25-JUL-68 FROM DEC MTCSR6 OF 7-MAY-68 31: 32: ;STATUS BITS IN MTS. * MEANS CAUSES INTERRUPT WHEN ENABLED. 33: ;NAMES ARE TAKEN FROM "MAGNETIC TAPE CONTROL 516 INSTRUCTION MANUAL" H-516 34: 35: ICR←←1B35 ;* INTERFACE AND CONTROL READY 36: RDY←←1B34 ; TAPE TRANSPORT READY 37: ERF←←1B33 ;* END OF RECORD FLAG 38: PER←←1B32 ; LATERAL PARITY ERROR 39: LPE←←1B31 ; LONGITUDINAL PARITY ERROR 40: RCE←←1B30 ; READ COMPARE ERROR (NOT USED) 41: MIS←←1B29 ; TAPE MISSED CHARACTER 42: TWL←←1B28 ; TAPE WRITE-ENABLE LOCKOUT RING OUT 43: EFF←←1B27 ; END-OF-FILE SENSED 44: BCT←←1B26 ; OTHER COMPUTER USING TRANSPORT OR IN LOCAL 45: TLR←←1B25 ; LAST OPERATION WAS A WRITE (NOT USED) 46: TLP←←1B24 ; TAPE AT LOAD POINT 47: TEP←←1B23 ; TAPE AT END POINT 48: RWD←←1B22 ; TRANSPORT IS REWINDING 49: XNC←←1B21 ;* TRANSFER NEW COMMAND 50: LIF←←1B20 ;* LOAD POINT INTERRUPT FLAG (NOT USED) 51: DCS←←1B19 ; DATA CONTROL SELECTED (NOT USED) 52: ILC←←1B18 ; ILLEGAL COMMAND: 53: ; WRITE OR WEF ON A WRITE-LOCKED TAPE 54: ; BACKSPACE RECORD, BACKSPACE FILE, OR READ 55: ; BACKWARDS WHILE AT BEGINNING OF TAPE 56: ; ANY OPERATION ON A TRANSPORT BEING USED 57: ; BY THE OTHER COMPUTER 58: 60: ;MTC CONO BITS: 61: ;BITS 33-35 ARE PI CHANNEL ASSIGNMENT (=MTCCHN) 62: ;BITS 29-31 ARE UNIT SELECT, BYTE POINTER IS PUNIT 63: ;BIT 28 IS "DO NOT RETURN TO POOL" (NOT USED) 64: ;BITS 24-27 ARE "FUNCTION". THEY ARE AS FOLLOWS: 65: ; 00=NO OPERATION (UNUSED) 66: ; 01=REWIND 67: ; 02=WRITE 68: ; 03=WRITE END-OF-FILE 69: ; 04=READ-COMPARE (NOT USED) 70: ; 05=READ 71: ; 06=SPACE FORWARD RECORD 72: ; 07=BACKSPACE RECORD 73: ; 10=NO OPERATION (NOT USED) 74: ; 11=REWIND AND UNLOAD (SAME AS REWIND AT STANFORD) 75: ; 12=READ ACROSS RECORD (NOT USED) 76: ; 13=WRITE THREE INCHES (APPROX) OF MAG TAPE 77: ; 14=WRITE WITH LONG EOR (NOT USED) 78: ; 15=READ BACKWARD (NOT USED) 79: ; 16=SPACE FORWARD FILE 80: ; 17=BACKSPACE FILE 81: ;BITS 22-23 SPECIFY DENSITY: 82: ; 0=200 BPI 83: ; 1=556 BPI 84: ; 2=800 BPI 85: ; 3=556 BPI 86: ;BIT 21 SPECIFIES PARITY 87: ; 0=EVEN 88: ; 1=ODD 89: ;BIT 20 SPECIFIES SLICE LEVEL 90: ; 0=HIGH (NORMAL) 91: ; 1=LOW 92: 93: 94: MTDC←←2 ;MAG TAPE DATA CONTROL DEVICE NUMBER 95: SEL←←2 ;UNIT TO COMMAND BUFFER 96: IOSEOF←←4000 ;SPACING ONE RECORD FORWARD FOUND EOF 97: IODT←←10000 ;A 1 FOR A DATA TRANSFER TYPE COMMAND 98: IOSLIC←←20000 ;A 1 IF SLICE LEVEL IS 1, OTHERWISE 0. 99: HASMT←←40000 ;IF A 1, THIS JOB HAS THE MAG TAPE CONTROL 100: IOREW←←400000 ;A 1 IF UNIT IS REWINDING AND ANOTHER OPERATION 101: ;IS ATTEMPTED ON SAME UNIT. MUST BE SIGN BIT. 102: MTREDO←←=10 ;NUMBER OF TIMES TO RETRY ON ERRORS 104: ;MAG TAPE SERVICE DISPATCH 105: 106: JRST MTCINI ;INITIALIZATION 107: JRST CPOPJ1 ;MTA HUNG TIMEOUT. RELEASE DATA CONTROL, 108: ;MAGTAPE CONTROL, PRINT ERROR AND STOP JOB 109: ↑MTCDSP: 110: JRST WAIT1 ;RELEASE - WAIT FOR IOACT TO BE OFF. 111: JRST MTCLSO ;CLOSE OUTPUT 112: JRST MTOUT ;OUTPUT 113: JRST MTIN ;INPUT 114: JRST CPOPJ1 ;ENTER IN DIRECTORY 115: JRST CPOPJ1 ;LOOKUP IN DIRECTORY 116: JRST MTDMPO ;DUMP OUTPUT 117: JRST MTDMPI ;DUMP INPUT 118: POPJ P, ;SETO 119: POPJ P, ;SETI 120: POPJ P, ;GETF 121: JRST CPOPJ1 ;RENAME 122: POPJ P, ;CLOSE INPUT 123: POPJ P, ;UTPCLR 124: JRST MTAPEU ;MTAPE UUO 125: 127: ; MTAPE UUO 128: ;THE FOLLOWING MTAPES ARE LEGAL: 129: C←←0 130: C←←C!1B35 ;0 = NOP 131: C←←C!1B34 ;1 = REWIND 132: C←←C!1B26 ;11= REWIND, UNLOAD 133: C←←C!1B28 ;7 = BACKSPACE RECORD 134: C←←C!1B20 ;17= BACKSPACE FILE 135: C←←C!1B32 ;3 = WRITE END OF FILE 136: C←←C!1B29 ;6 = SPACE FORWARD RECORD 137: C←←C!1B21 ;16= SPACE FORWARD FILE 138: C←←C!1B24 ;13= WRITE 3" OF BLANK TAPE 139: C←←C!1B27 ;10= SKIP TO LOGICAL EOT (PROGRAMMED) 140: 141: MTAPEU: MOVEI ITEM,1 ;CHECK FOR LEGAL MTAPE UUO 142: LSH ITEM,(UUO) ;SHIFT BIT ACCORDING TO THE USER'S UUO 143: TRNN ITEM,C ;DID HE SPECIFY A LEGAL CODE ? 144: JRST UUOERR ;NO--TYPE MONITOR ERROR MESSAGE. 145: SOJE ITEM,MTP0 ;CHECK FOR MTAPE 0 (SPECIAL SYNC WAIT NO-OP) 146: PUSHJ P,MTCHK2 ;MAKE SURE SYSTEM IS AVAILABLE. 147: TRZ IOS,776000 ;CLEAR ERROR BITS: IOF, IOACT, IOBOT AND IOTEND. 148: SKIPA ITEM,UUO ;CALL MTAPE2 149: MTAPE: PUSHJ P,MTCHK2 ;CHECK IF MAG TAPE CONTROL AVAIL. 150: MTAPE2: TDZ IOS,[XWD IODT!IOSEOF,IOACT] 151: TRNN ITEM,SLICE ;SET SLICE LEVEL THIS UUO? 152: JRST NOSET ;NO 153: TLZ IOS,IOSLIC ;YES, CLEAR LEVEL 154: TRNE ITEM,SLEVEL ;SET TO 1? 155: TLO IOS,IOSLIC ;YES 156: NOSET: LSH ITEM,=8 ;MOVE CODE TO MT FUNCTION POSITION 157: ANDI ITEM,17B27 ;LEAVE ONLY THE FUNCTION BITS 158: CAIN ITEM,10B27 ;LOGICAL EOT? 159: JRST MTLEOT ;YES. 160: CONSO MTS,TLP ;AT LOAD POINT? 161: JRST MTGO1 ;NOT AT LOAD POINT. 162: CAIE ITEM,7B27 ;YES, BACKSPACE RECORD? 163: CAIN ITEM,1B27 ;NO, REW? 164: JRST MTFIN ;AVOID BACKWARDS MOTION WHEN AT LOAD POINT 165: CAIN ITEM,17B27 ;NO. BACKSPACE FILE? 166: JRST MTFIN ;YES. AVOID BACKWARDS MOTION FROM LOAD POINT. 167: 168: 169: MTGO1: LDB TAC,PUNIT ;IN, OUT, MTAPE UUOS & INTERRUPT FOR NEXT RECORD 170: DPB TAC,[POINT 3,ITEM,31] ;FROM COMMAND IN ITEM. STORE UNIT NUMBER. 171: LDB TAC,[POINT 3,IOS,28] ;DENSITY PARITY 172: TRNN TAC,7 ;NO DENSITY OR PARITY SPECIFIED? 173: IORI TAC,STDENS ;YES, USE STANDARD 174: XORI TAC,5 ;ODD, 556 175: DPB TAC,[POINT 3,ITEM,23] 176: MOVEI TAC,MTCCHN(ITEM);ADD PI CHANNEL TO COMMAND 177: TLNE IOS,IOSLIC ;SLICE LEVEL A 1? 178: TRO TAC,100000 ;YES, SET COMMAND. 179: SETZM MTEOFF ;CLEAR EOF FLAG 180: HRRM DDB,MTDEV 181: HRLM TAC,MTDEV ;COMMAND,,DDB ADDRESS INTO MTDEV 182: MOVEI TAC1,MTNIO2 ;ASSUME NON-DATA TRANSFER 183: TLNN IOS,IODT ;IS THIS A DATA TRANSFER OPERATION REQUIRING DC? 184: JRST MTGO2 ;NO, MUST BE SPACING OPERATION 185: CONO DC,@MDCSAV ;YES, ATTACH DC TO MAGTAPE 186: CONO PI,DCTON ;TURN DC PI CHANNEL ON 187: SETZM MISSED ;CLEAR DATA MISSED FLAG 188: MOVEI TAC1,MTXNC ;ON INTERRUPT, GO TO MTXNC 189: MTGO2: MOVEM TAC1,MTIDSP ;STORE DISPATCH ADDRESS FOR INTERRUPT 190: PUSH P,TAC 191: PUSHJ P,STOIOS 192: POP P,TAC 193: HRLI TAC,XNC 194: CONO PI,PIOFF ;DISABLE INTERRUPTS 195: CONO MTC,(TAC) ;ISSUE OPERATION TO CONTROLLER 196: HLRM TAC,MTCCON ;ENABLE SOFTWARE FOR XNC 197: CONO MTS,XNC ;ENABLE HARDWARE FOR XNC 198: CONO PI,PION ;ENABLE INTERRUPTS 199: POPJ P, ;EXIT 201: ;IS SYSTEM AVAILABLE 202: MTCHEK: PUSHJ P,GETDCMT ;GET DATA AND MAG TAPE CONTROLS 203: AOSE MTREQ ;ARGUMENT 204: MOVE IOS,DEVIOS(DDB) 205: TLO IOS,IODT ;FLAG DATA TRANSFER 206: PUSHJ P,MTCHK4 ;WAIT FOR REWIND 207: JRST MTCHEK ;GET DC & MT AGAIN 208: JRST SETACT ;SET DEV. ACTIVE BIT 209: 210: MTCHK2: AOSE MTREQ ;GET MAGTAPE CONTROL ONLY-SPACING OPERATION. 211: PUSHJ P,MTWAIT 212: MOVE IOS,DEVIOS(DDB) 213: PUSHJ P,MTCHK4 ;CHECK STATUS 214: JRST MTCHK2 ;GET MT AGAIN 215: POPJ P, 216: 217: MTCHK4: TLO IOS,HASMT ;THIS JOB NOW HAS MTC 218: TLZE IOS,IOBEG ;FIRST OPERATION AFTER INIT 219: TLZ IOS,IOSLIC ;YES, SET SLICE LEVEL TO 0. 220: TLZ IOS,IOREW ;CLEAR MAG TAPE REWINDING 221: PUSHJ P,REWCK ;CHECK IF REWINDING? 222: JRST CPOPJ1 ;NO - STATUS OK 223: JRST QSTAT ;QUERY STATUS 224: PUSHJ P,DETMDC ;REWINDING- DETACH MTC, DC AND TURN OFF IODT & HASMT 225: TLO IOS,IOREW+IOW ;SET REWIND WAIT, IO WAIT 226: MOVEM IOS,DEVIOS(DDB) ;STORE IOS 227: AOSG MTREWN ;ADD 1 TO REWIND WAIT COUNT SKIP IF CLREQ IN 228: PUSHJ P,MTCLK ;MAKE A CLOCK REQUEST. THIS IS ONLY UNIT REWINDING 229: PUSH P,J ;SAVE J 230: LDB J,PJOBN ;GET THE JOB NUMBER OF TAPE OWNER 231: MOVNI AC1,IOWQ ;REQUE THIS GUY 232: MOVEM AC1,JOBQUE(J) ;TO IOWQ UNTIL MT REWINDS 233: PUSHJ P,REQUE ; 234: POP P,J ;RESTORE J 235: JRST WSCHED ;WAIT... 236: 237: QSTAT: PUSHJ P,DETMDC ;DETACH MTC AND DC 238: LDB J,PJOBN ;LOAD UP JOB NUMBER 239: JRST HNGSTP ;CHECK STATUS (PULL FINGERS OUT, ETC) 241: ;MTAPE 0 WAITS UNTIL THE CONTROL IS FREE 242: ;THUS MTAPE 0 PROVIDES THE ONLY WAY FOR A USER TO WAIT UNTIL A SPACING OPERATION 243: ; (I.E., SKIP, BACKSPACE, OR REWIND) IS COMPLETED. 244: 245: MTP0: PUSHJ PDP,MTCHK2 ;WAIT FOR CONTROL TO BECOME FREE, 246: ; THEN GIVE IT BACK IMMEDIATELY, 247: ; AND RETURN TO THE USER. 248: 249: 250: 251: 252: ;DETMDC- 253: ; DETACH MTC, AND TURN OFF HASMT. 254: ; THEN (IFF IODT ON) 255: ; TURN OFF IODT AND DETACH DC 256: 257: ↑DETMDC: 258: TLZN IOS,HASMT ;THIS JOB HAS MTC? 259: JRST STOIOS ;NO 260: SOSL MTREQ ;YES- ANYONE ELSE WAITING FOR IT? 261: SETOM MTAVAL ;YES- FLAG AS JUST BECOME AVAILABLE 262: ↑DETDC: TLZN IOS,IODT ;DOES JOB HAVE DATA CONTROL? 263: JRST STOIOS ;NO- EXIT 264: SOSL DCREQ ;ANYONE ELSE WAITING FOR IT? 265: SETOM DCAVAL ;YES- FLAG AS JUST BECOME AVAILABLE 266: JRST STOIOS ;AND EXIT 267: 268: MTHUNG: TLNN IOS,HASMT 269: POPJ P, ;HOW DID WE GET HERE IF HE DIDN'T HAVE IT? 270: CONO MTS,400000 ;FLUSH CURRENT COMMAND 271: CONO MTC,0 ;GRONK DELAYS 272: TLNE IOS,IODT ;DOES HE HAVE THE DATA CONTROL? 273: CONO DC,0 ;HOLD DATA CONTROL 274: JRST DETMDC ;DEATCH EVERYTHING. 276: ;ROUTINE TO SEE IF UNIT IS REWINDING 277: ;CALL MOVE DEVDAT,ADDRESS OF DDB 278: ; PUSHJ PDP,REWCK 279: ; UNIT READY 280: ; UNIT OFF 281: ; UNIT REWINDING 282: 283: REWCK: LDB TAC,PUNIT 284: ROT TAC,4 285: CONO MTC,MTCCHN(TAC) 286: CONO MTS,SEL ;JAM UNIT INTO COMMAND BUFFER 287: CONSZ MTS,RWD ;SKIP IF REWIND MOTION OFF 288: JRST CPOPJ2 ;RETURN TO CALL+2 IF TAPE REWINDING 289: CONSO MTS,BCT ;OTHER COMPUTER USING TRANSPORT, OR IN LOCAL? 290: CONSO MTS,RDY ;IS UNIT READY? 291: JRST CPOPJ1 ;UNIT UNREADY OR UNAVAILABLE 292: CONSZ MTS,TLP ;UNIT READY AND AVAILABLE IS IT AT LOAD POINT? 293: IORI IOS,IOBOT ;YES. 294: CONSZ MTS,TEP ;END POINT? 295: IORI IOS,IOTEND ;YES. 296: POPJ PDP, ;UNIT HAPPY. DIRECT RETURN 297: 298: 299: COMMENT $ 300: THIS WORKS WITH THE FOLLOWING MOD TO 545 TRANSPORT: 301: 302: DELETE 1B23K TO ?? 303: 304: ADD 1B16K TO 1B08K REW(1)(GND) BUFFERED 305: 1B19S TO 1B08L FWD/LP(1)(GND) 306: 1B08N TO 1B23K (REW(1).OR.FWD/LP(1)) 307: 308: THIS MOD SETS IOB22(1) WHILE MAGTAPE IS REWINDING OR SPACING FORWARD 309: TO LOAD POINT- IE ENABLES THE PROCESSOR TO DISTINGUISH BETWEEN A 310: TAPE WHICH IS AT THE END OF A REWIND COMMAND, AND A TAPE WHICH IS 311: SWITCHED TO LOCAL, OR OFF 312: 313: ADD 1B08U TO 1B08N CLAMPED LOAD FOR LOCAL 314: 1B08R TO 1B10J LOCAL (-3V) 315: 1B08S TO 1B15F SELECT (-3V) 316: 1B08V TO P1-42 LOCAL STATUS TO OLD POOL STATUS BIT 317: P1-42 TO P2-42 ADD THROUGH CONNECTION FOR DRIVES BEYOND 318: 319: THIS MOD MAKES BIT 26 OF CONI 224, A ONE IF THE SELECTED 320: DRIVE IS IN LOCAL. IT USES A SPARE SECTION OF R111 IN EACH 545 321: AND LOGIC IN THE 516/521 USED FOR POOLING WITH 570 TAPE DRIVES. 322: $ 324: ;READ AND WRITE 325: 326: MTIN: PUSHJ P,MTCHEK ;IS SYSTEM AVAILABLE? 327: TLZ IOS,IO ;READING. 328: MTIN1: SETCM TAC,@DEVIAD(DDB) ;-SIZE-1 329: HRRI TAC,@DEVIAD(DDB) ;BUFFER ADDRESS,PROG INCLUDED 330: ADD TAC,[XWD 2,1] ;-SIZE+1,BUFFER+1 331: MOVEI ITEM,5B27 ;READ 332: MOVE TAC1,[BLKI DC,4000!<MTDC*10>!DCTCHN] 333: JRST MTINDC 334: 335: MTOUT: PUSHJ P,MTCHEK 336: TLO IOS,IO ;WRITING 337: CONSZ MTS,TWL ;IS FILE PROTECT RING IN? 338: JRST MTOUTE ;NO, ERROR CANT WRITE. CROCK!! 339: MTOUT1: MOVEI TAC,@DEVOAD(DDB) ;BUFFER ADDRESS, PROG INCLUDED 340: MOVN TAC1,1(TAC) ;-WD COUNT 341: JUMPE TAC1,MTNOPO ;IF WC=0, DONT DO ANYTHING 342: HRL TAC,TAC1 ;-WD CMT,BUFFER 343: ADDI TAC,1 ;BUFFER+1 344: MOVE TAC1,[BLKO DC,3400!<MTDC*10>!DCTCHN] 345: MOVEI ITEM,2B27 ;WRITE 346: MTINDC: CONO PI,DCTOFF ;TURN DATA CONTROL PI CHANNEL OFF 347: MOVEM TAC,MTDCCN ;BLKO POINTER 348: MOVEM TAC,DCWRD 349: HRRZM TAC1,MDCSAV ;SAVE DC COMMAND 350: HRRI TAC1,DCWRD 351: MOVEM TAC1,@DCLOC ;BLK COMMAND 352: MOVE TAC1,[JSR MTDCND] 353: MOVEM TAC1,@DCLOC1 354: IORI IOS,IOACT ;SET IOACT 355: JRST MTGO1 ;GO START OPERATION 356: 357: MTOUTE: TRO IOS,IOIMPM ;WRITE LOCK, DEVICE ERROR 358: JRST MTNOP1 ;DETACH DATA CONTROL AND MAG TAPE. RETURN TO UUOCON 359: 360: MTNOPO: PUSHJ P,ADVBFE ;ADVANCE OVER THE EMPTY BUFFER 361: JFCL ;IGNORE CONTINUE INDICATION 362: MTNOP1: PUSHJ P,ETCHK ;JUST IN CASE 363: TLZE IOS,IOW ;UNWAIT THE JOB 364: PUSHJ P,SETIOD 365: PUSHJ P,CLRACT 366: JRST DETMDC ;DETACH EVERYTHING AND RETURN 368: ;CLOSE OUTPUT 369: 370: MTCLSO: TLNN DDB,OUTPB ;HAS AN OUTPUT BEEN DONE? 371: POPJ P, ;NO. DONT WRITE ON TAPE. 372: LDB TAC,PIOMOD ;DUMP MODE? 373: CAIGE TAC,DR 374: PUSHJ P,OUT ;BUFFERED MODE: OUTPUT LAST PARTIAL BUFFER 375: PUSHJ P,WSYNC ;WAIT FOR OUTPUT TO FINISH 376: PUSH P,ITEM ;DON'T CLOBBER J!!! 377: MOVEI ITEM,3 ;WRITE EOF 378: PUSHJ P, MTAPE 379: MOVEI ITEM,3 ;WRITE EOF 380: PUSHJ P,MTAPE 381: MOVEI ITEM,7 ;BSP 382: PUSHJ P,MTAPE 383: POP P,ITEM ;RESTORE J 384: POPJ P, 385: 386: 387: MTCINI: SETOM MTREWN ;SET CLOCK REQUEST COUNT TO -1 388: MOVEI TAC,40+DCTCHN*2 389: CONSZ APR,MAOFF ; MA TRAP OFFSET? 390: ADDI TAC,100 ; YES, OFFSET ADDRESS 391: MOVEM TAC,DCLOC 392: ADDI TAC,1 393: MOVEM TAC,DCLOC1 394: JRST MTNIO1 395: 396: 397: ;BLK COUNTED OUT 398: 399: ↑MTDCN1: 400: CONO PI,DCTOFF ;SHUT OFF DC CHANNEL 401: CONSZ DC,10000 ;DATA MISSED? 402: SETOM MISSED ;YES. OOPS 403: JEN @MTDCND ;DISMISS INTERRUPT. 405: ;INTERRUPTS FROM MAG TAPE CONTROL ARE SENT HERE FROM IOINIT 406: ↑MTCINT:JSR MTCSAV ;SAVE AC'S 407: HRRZ DDB,MTDEV ;SET UP DDB POINTER 408: LDB PROG,PJOBN ;JOB NUMBER 409: MOVE PROG,JBTADR(PROG) 410: MOVE IOS,DEVIOS(DDB) 411: JRST @MTIDSP ;DISPATCH TO WHOEVER WANTS INTERRUPT. 412: 413: ;HERE ON FIRST INTERRUPT FROM DATA TRANSFER OPERATION (XNC) 414: MTXNC: MOVEI TAC,ERF ;ENABLE SOFTWARE FOR ERF 415: HRRM TAC,MTCCON 416: MOVEI TAC,MTEOR ;SET DISPATCH ADDRESS TO MTEOR 417: MOVEM TAC,MTIDSP 418: CONO MTS,ERF ;ENABLE HARDWARE FOR ERF 419: POPJ P, ;DISMISS INTERRUPT 420: 421: ;HERE ON ERF INTERRUPT FROM DATA TRANSFER OPERATION 422: MTEOR: CONO PI,DCTOFF ;TURN OFF DC IN CASE BLKI/BLKO DIDNT OVERFLOW 423: CONSZ DC,10000 ;DATA MISS? 424: SETOM MISSED ;YES. 425: CONSZ MTS,EFF ;END-OF-FILE? 426: SETOM MTEOFF ;YES. SET FLAG 427: 428: MOVE ITEM,DCWRD ;GET THE IOWD 429: TLNE IOS,IO ;SKIP IF INPUT 430: TLNN ITEM,-1 ;OUTPUT. SKIP IF WORDS REMAIN IN THE IOWD 431: JRST MTEOR0 ;INPUT OR IOWD EXHAUSTED. 432: SETOM MISSED ;SET DATA MISSED. - OUTPUT FAILED TO EXHAUST IOWD 433: JRST MTEOR2 ;ERROR. 434: 435: MTEOR0: CONSO DC,160000 ;DATA REMAINING IN DC? 436: JRST MTEOR1 ;NO. 437: TLNN IOS,IO ;OUTPUT? 438: SKIPE MISSED ;NO. DATA MISSED? 439: JRST MTEOR2 ;YES. ERROR. 440: CONI DC,TAC1 ;FETCH DC STATUS BITS 441: LSH TAC1,-15 ;SHIFT CHARACTER COUNT TO LSBITS 442: IMULI TAC1,-6 ;-NO OF BITS TOO FAR RIGHT 443: CONO DC,@MDCSAV ;?? IF DON SAYS SO, WELL, OK (JUST) 444: DATAI DC,TAC ;FETCH LAST PART-WORD OF DATA 445: LSH TAC,44(TAC1) ;SHIFT LAST CHARACTERS TO LEFT END 446: JUMPG ITEM,MTEOR1 447: AOBJN ITEM,.+1 ;BUMP DATA POINTER 448: MOVEM TAC,(ITEM) ;STORE LAST WORD 449: MOVEM ITEM,DCWRD ;LET LOSER SEE LAST WORD, PLS! (DWP 3 MAY 71) 450: CONO DC,0 ;SHUT DOWN DC. 451: 452: MTEOR1: CONSZ MTS,LPE!PER!ILC!MIS 453: ;IF END OF RECORD, CHECK 454: ;PARITY,DATA MISSED, AND ILLEGAL FLAG 455: JRST MTEOR2 ;IF ERROR CAUSE INTERRUPT TO 456: ;ERROR ROUTIE VIA ICR 458: MTPDUN: AOS MTCBKN(DDB) ;COUNT NR. OF BLOCKS READ OR WRITTEN FOR THIS DRIVE 459: LDB TAC,PIOMOD 460: CAIL TAC,DR 461: JRST DMPDUN ;DUMP 462: TLNE IOS,IO 463: JRST MTNOTI ;WRITING 464: SKIPE MTEOFF ;NOT EOF? 465: JRST MTEOF 466: MOVEI TAC,@DEVIAD(DDB);BUFFER ADDRESS 467: JUMPE TAC,MTEND1 ;JUMP IF RELEASE HAS WIPED OUT BUFFERS 468: MOVN TAC1,MTDCCN ;WD CNT-1 469: AOBJN TAC1,.+1 ;WD CNT 470: HLLZ TAC1,TAC1 ;CLR RT HALF 471: ADD TAC1,DCWRD ;ADD CURRENT COUNT=NO. OF WDS 472: HLRM TAC1,1(TAC) ;STORE AT WORD COUNT 473: PUSHJ P,ADVBFF 474: JRST MTEND1 ;NEXT BUFFER FULL 475: JRST MTCONN ;CONTINUE MODE 476: 477: DMPDUN: TLNN IOS,IO ;INPUT OR OUTPUT? 478: SKIPN MTEOFF ;ONLY CHECK EOF ON INPUT 479: SKIPA ;OUTPUT OR INPUT+EOF 480: TRO IOS,IODEND ;INPUT+EOF 481: SETZM MTEOFF ;RESET EOF FLAG IN CASE SET. 482: PUSHJ PDP,ETCHK ;CHECK FOR EOT 483: AOS TAC,MTCMDP ;NEXT ITEM IN COMMAND LIST. 484: TLNN IOS,IO ;READING OR WRITING? 485: JRST MTDPI1 ;READING 486: JRST MTDPO1 ;WRITING. 487: 488: MTEOF: TLO IOS,IOEND 489: SETZM MTEOFF ;CLEAR EOF FLAG 490: 491: ;AND FALL INTO MTEND1 493: MTEND1: CONO DC,0 ;TURN OFF DATA CONTROL 494: CONO PI,DCTOFF 495: PUSHJ P,DETDC ;DETACH DC (IF ASSIGNED) 496: PUSHJ P,ETCHK ;CHECK FOR END OF TAPE (FOR DUMP MODE OUT) 497: PUSHJ P,CLRACT ;CLEAR IOACT, STORE IOS 498: MOVEI TAC,MTFIN ;SET DISPATCH ADDRESS TO MTFIN 499: MOVEM TAC,MTIDSP 500: HRRZM DDB,MTDEV ;STORE DDB ADDTRESS (DUMP MODE) 501: JRST MTIGN ;RETURN WHEN ICR 502: 503: ;HERE ON XNC INTERRUPT FROM NON-DATA TRANSFER. 504: MTNIO2: PUSHJ P,MTERST ;RETURN WHEN ICR 505: HLRZ TAC,MTDEV ;COMMAND 506: ANDI TAC,17B27 507: CAIE TAC,6B27 ;NO. SPACING ONE RECORD? 508: JRST MTNIO ;YES, EXIT 509: CONSZ MTS,EFF ;EOF? 510: TDO IOS,[XWD IOSEOF,IODEND] 511: MTFIN: 512: MTNIO: TLZE IOS,IOW ;CLEAR WAIT 513: PUSHJ P,SETIOD 514: PUSHJ P,DETMDC ;DETACH MTC (IF HASMT SET) AND DC (IF IODT) 515: PUSHJ P,ETCHK ;CHECK FOR END OF TAPE 516: PUSHJ P,CLRACT ;RESTORE BITS,CLEAR IOACT 517: 518: ;AND FALL INTO MTNIO1 520: MTNIO1: CONO MTS,0 ;CLEAR MAG TAPE ENABLES. 521: CONO MTC,MTCCHN ;CLEAR MAG TAPE CONTROL. 522: HLLZS MTCCON ;CLEAR THE INTERRUPT MASK BITS. 523: MOVNI TAC,MTREDO ;REPEAT COUNTER 524: MOVEM TAC,MTERCN 525: SKIPGE MTREWN ;SOME OTHER UNIT REWINDING WITH A COMMAND HELD UP? 526: POPJ P, ;NO, DISMISS INTERRUPT 527: 528: ;SOME UNIT IS REWINDING AND HAS HAD ANOTHER COMMAND HELD UP. 529: ;CHECK ALL UNITS 530: 531: MTREWW: SETOM MTREWN ;SET COUNT TO NO. UNITS IN REW WAIT 532: PUSH P,DDB 533: MOVEI DDB,MTCDDB ;GET BEGINNING OF MT DATA BLOCK CHAIN 534: 535: REWLP: MOVE IOS,DEVIOS(DDB) 536: JUMPGE IOS,REW2 ;IS UNIT IN A REW WAIT? 537: PUSHJ PDP,REWCK ;YES,SEE IF FINISHED REW. 538: JRST .+3 ;HAS FINISHED REWINDING 539: JRST .+2 ;OFF- WAKE JOB AND LET HIM LOSE. 540: JRST REW0 ;STILL REWINDING 541: TDZ IOS,[XWD IOREW,IOACT] ;GET JOB OUT OF IO WAIT 542: TLZE IOS,IOW 543: PUSHJ P,SETIOD ;START JOB UP AGAIN 544: MOVEM IOS,DEVIOS(DDB) 545: JRST REW2 546: 547: REW0: PUSHJ P,STOIOS ;RESET HUNG COUNT IF STILL REWINDING 548: REW1: AOS MTREWN ;INCREMENT COUNT OF REW WAIT UNITS 549: REW2: HLRZ DDB,DEVSER(DDB) ;LINK TO NEXT DDB 550: JUMPE DDB,REW3 ;LAST DDB? 551: HLRZ DAT,DEVNAM(DDB) ;NO. GET LH OF NAME. 552: CAIN DAT,'MTA' ;IS THIS A MAGTAPE? 553: JRST REWLP ;YES. CONTINUE 554: REW3: POP P,DDB 555: POPJ P, ;YES, DISMISS INTERRUPT OR RETURN TO MTCLOK 556: 557: ETCHK: CONSZ MTS,TEP ;EOT SEEN? 558: IORI IOS,IOIMPM!IOTEND ;YES- SET FLAGS ;THIS IS A CROCK! 559: TDZ IOS,[XWD IOREW,IOBOT] ;NO LONGER REWINDING 560: CONSZ MTS,RWD!TLP ;UNLESS 561: TRO IOS,IOBOT ;IS REALLY REWINDING 562: POPJ P, ;EXIT 564: ;ROUTINE CALLED AT CLOCK LEVEL TO SEE IF ANY UNITS WHICH ARE IN A 565: ;REW WAIT HAVE FINISHED REWIND. 566: 567: MTCLOK: SKIPGE MTREQ ;IS ANY JOB USING ANY UNIT NOW? 568: PUSHJ P,MTREWW ;NO, CHECK ALL MAG TAPE 569: ;UNITS TO SEE IF JUST FINISHED 570: ;REWINDING(WHICH WERE IN REW WAIT) 571: SKIPGE MTREWN ;YES,ARE ANY UNITS STILL IN REW WAIT? 572: POPJ P, ;NO, RETURN TO CLOCK ROUTINE WITHOUT 573: ;PUTTING IN CLOCK REQUEST 574: 575: ;ROUTINE TO PUT IN A CLOCK REQUEST 576: 577: MTCLK: MOVEI TAC1,JIFSEC/2 ;CHECK EVERY HALF SECOND 578: HRLI TAC1,MTCLOK ;DISPATCH ADDRESS 579: CONO PI,PIOFF ;TURN OFF PI 580: IDPB TAC1,CLOCK ;STORE CLOCK REQUEST 581: CONO PI,PION ;TURN ON PI 582: POPJ P, 584: MTNOTI: PUSHJ P,ADVBFE ;WRITING 585: JRST MTEND1 586: MTCONN: 587: CONSZ MTS,TEP!BCT ;END OF TAPE OR IN LOCAL? 588: JRST MTEND1 ;STOP TAPE 589: CONO DC,0 ;CLEAR DATA CONTROL 590: TLZE IOS,IOW 591: PUSHJ P,SETIOD 592: MOVEM IOS,DEVIOS(DDB) 593: MOVNI TAC,MTREDO 594: MOVEM TAC,MTERCN 595: TLNN IOS,IO ;INPUT OR OUTPUT? 596: JRST MTIN1 ;CALL INPUT SUBROUTINE 597: JRST MTOUT1 ;CALL OUTPUT SUBROUTINE 599: MTEOR2: SKIPE MTEOFF ;END-OF-FILE? 600: JRST MTPDUN ;YES. IGNORE ERRORS. 601: MTERR: MOVEI ITEM,0 602: CONSZ MTS,LPE ;LONGITUDINAL PARITY ERROR? 603: TLO ITEM,1000 ;YES, COUNT IN QUARTER 1 604: CONSZ MTS,PER ;LATERAL PARITY ERROR? 605: TLO ITEM,1 ;YES, COUNT IN QUARTER 2 606: CONSZ MTS,ILC ;ILLEGAL OP? 607: TRO ITEM,1000 ;YES, COUNT IN QUARTER 3 608: SKIPE MISSED ;DATA MISSED? 609: TRO ITEM,1 ;YES, COUNT IN QUARTER 4 610: ADDM ITEM,MTCENT(DEVDAT);ADD TO ERROR COUNTS FOR THIS DRIVE 611: TRNE IOS,IONRCK ;DOES USER WANT TO SUPPRESS ERROR HANDLING? 612: JRST MTERR3 ;YES, GIVE HIM HIS ERROR BITS 613: PUSHJ P,MTERST ;RETURN ON ICR 614: AOSL MTERCN ;ENOUGH ERRORS? 615: JRST MTERR2 ;YES. 616: HLRZ TAC,MTDEV ;COMMAND 617: ANDCMI TAC,17B27 618: MOVEI TAC,7B27(TAC) ;BSP 619: PUSHJ P,MTXCT ;INITIATE THE OPERATION 620: PUSHJ P,MTERST ;RETURN WHEN OPERATION COMPLETE. 621: 622: ;COME HERE AFTER ERROR BACKSPACE OR WRITE BLANK TAPE 623: ;TO RE-ISSUE THE READ OR WRITE COMMAND. 624: 625: MRETRY: LDB TAC,PIOMOD ;GET MODE. 626: CAIL TAC,DR ;DUMP MODE? 627: JRST MDRTRY ;YES. 628: TLNE IOS,IO ;INPUT OR OUTPUT? 629: JRST MTOUT1 ;OUTPUT 630: JRST MTIN1 ;INPUT 631: 632: ;COME HERE AFTER ENOUGH RETRIES. ASSUME ERROR 633: ;IS PERMANENT. 634: 635: MTERR2: TLNE IOS,IO ;WRITING? 636: JRST WRBLNK ;YES. ERASE BAD SPOT. 637: MTERR3: CONSO MTS,ILC!MIS ;SET IODERR IF ILLEG OR MISSED CHAR FLAGS 638: SKIPE MISSED ;SET IODERR IF DATA MISSED 639: TRO IOS,IODERR 640: CONSZ MTS,LPE!PER ;SET IODTER IF LONG OR LAT PARITY 641: TRO IOS,IODTER 642: JRST MTPDUN 644: ;THIS ROUTINE BACKSPACES OVER ONE RECORD (A BAD ONE) THEN 645: ;WRITES 3" OF BLANK TAPE WHICH WILL BE SKIPPED OVER ON 646: ;INPUT (LOOKS LIKE A LONG INTER-RECORD GAP). THE PROCESS 647: ;CONTINUES UNTIL NO ERRORS ARE ENCOUNTERED OR EOT IS REACHED. 648: 649: WRBLNK: CONSZ MTS,TEP ;EOT? 650: JRST MTFIN ;YES. GIVE UP. 651: HLRZ TAC,MTDEV ;LAST COMMAND 652: ANDCMI TAC,17B27 ;MASK OUT IRREVALENCIES 653: MOVEI TAC,7B27(TAC) ;BSP 654: PUSHJ P,MTXCT ;INITIATE THE OPERATION 655: PUSHJ P,MTERST ;RETURN WHEN BSR DONE. 656: HLRZ TAC,MTDEV ;GET BACK COMMAND 657: ANDCMI TAC,17B27 658: MOVEI TAC,13B27(TAC) ;WRITE 3" OF BLANK TAPE 659: PUSHJ P,MTXCT ;START THE WRITE 660: MOVNI TAC,MTREDO ;RESET ERROR COUNT. 661: HRREM TAC,MTERCN 662: PUSHJ P,MTERST ;WAIT FOR WBT. 663: JRST MRETRY ;GO RE-ISSUE READ OR WRITE. 664: 665: MTERST: POP P,MTIDSP ;STORE RETURN ADDRESS. 666: MTIGN: MOVEI TAC,ICR ;RETURN ON ICR 667: HRRM TAC,MTCCON 668: CONO MTS,ICR ;ENABLE HARDWARE FOR ICR 669: POPJ P, ;DISMISS INTERRUPT 670: 671: ;INITIATE THE EXECUTION OF AN MTAPE FOR THE 672: ; ERROR ROUTINES. MUST BE CALLED FROM INTERRUPT LEVEL 673: ; WITH INTERFACE AND CONTROL READY (ICR) 674: 675: MTXCT: POP P,MTIDSP ;STORE RETURN ADDRESS 676: MOVEI TAC1,XNC ;RETURN ON XNC 677: CONO PI,PIOFF 678: CONO MTC,(TAC) ;ISSUE THE OPERATION 679: CONO MTS,XNC ;ENABLE THE HARDWARE 680: HRRM TAC1,MTCCON ;AND THE SOFTWARE 681: CONO PI,PION ;ALLOW INTERRUPTS AGAIN 682: POPJ P, ;DISMISS INTERRUPT 684: ;LOGICAL END OF TAPE LOOP 685: MTLEOT: MOVEI ITEM,7 ;BACKSPACE 686: PUSHJ P,MTAPE2 687: PUSHJ P,MTCHK2 ;CALL INTERLOCK. PICKUP IOS 688: ;AFTER PREVIOS TASK FINISHED. 689: MTEOT2: MOVEI ITEM,16 ;SPACE ONE FILE 690: PUSHJ P,MTAPE2 691: MOVEI ITEM,6 ;SPACE ONE RECORD 692: PUSHJ P,MTAPE 693: PUSHJ P,MTCHK2 ;CALL INTERLOCK. 694: ;RETURN WHEN SPACING DONE WITH NEW IOS 695: TLNN IOS,IOSEOF ;WAS EOF DETECTED? 696: JRST MTEOT2 ;NO, RESUME SPACING. 697: MOVEI ITEM,7 ;PREPARE FOR BACKSPACE MTAPE 698: JRST MTAPE2 ;BACKSPACE, LOGICAL EOT FOUND RETURN TO CALLER 700: ;DEVICE DEPENDENT DUMP MODES. MODE 16. 701: ;OUTPUT: 702: MTDMPO: 703: PUSHJ P,COMCHK 704: JRST ADRERR 705: PUSHJ P,MTCHEK ;IS SYSTEM AVAILABLE 706: TLO IOS,IO ;WRITING 707: CONSZ MTS,TWL ;WRITE LOCK? 708: JRST MTOUTE ;YES. 709: MOVE TAC1,[BLKO DC,3400!<MTDC*10>!DCTCHN] 710: ;BLKO AND DATA CONTROL COMMAND 711: HRRZ TAC,UUO ; COMMAND LIST POINTER 712: MOVEI ITEM,2B27 ;WRITING COMMAND 713: MTDMP1: HRLI TAC,PROG ;ACTUAL ADDRESS OF COMMAND LIST 714: MOVEM TAC,MTCMDP ;COMMAND POINTER 715: SKIPN TAC,@TAC ;COMMAND WORD 716: JRST MTEND1 717: TLNN TAC,777777 718: JRST MTDMP1 ;CHANGE COMMAND SEQUENCE 719: HLROM TAC,SVCNTR ;SAVE COUNTER 720: MOVEI TAC,(TAC) ;GET ADDRESS ALONE 721: SUB TAC,SVCNTR ;GET LAST ADDRESS 722: CAILE TAC,JOBPFI ;ABOVE PROTECTED PART OF JOB DATA AREA? 723: CAMLE TAC,USRREL(PID) ;LESS THAN END? 724: JRST MTDMP2 ;OUT OF BOUNDS 725: MOVE TAC,@MTCMDP ;PICK UP POINTER AGAIN 726: ADDI TAC,(PROG) ;GET ACTUAL ADDRESS 727: PUSHJ P,MTINDC ;MOVE TAPE 728: JRST WAIT1 729: 730: ;INPUT 731: MTDMPI: 732: PUSHJ P,COMCHK 733: JRST ADRERR 734: PUSHJ P,MTCHEK 735: TLZ IOS,IO ;READING 736: TRNE IOS,IODEND ;END-OF-FILE? 737: JRST MTEND1 ;YES. GIVE BACK MAG TAPE. 738: MOVE TAC1,[BLKI DC,4000!<MTDC*10>!DCTCHN] 739: ;BLKI AND DATA CONTROL COMMAND 740: HRRZ TAC,UUO ;GET COMMAND LIST POINTER 741: MOVEI ITEM,5B27 ;READ COMMAND 742: JRST MTDMP1 ;DUMP 743: ;ADDRESS ERROR 744: 745: MTDMP2: PUSHJ P,MTEND1 746: JRST ADRERR 748: MTDPI1: TRNE IOS,IODEND ;EOF? 749: JRST MTEND1 ;YES. 750: MOVEI ITEM,5B27 ;READ COMMAND 751: MOVE TAC1,[BLKI DC,4000!<MTDC*10>!DCTCHN] 752: JRST MTDMP3 753: 754: MTDPO1: CONSZ MTS,TEP ;AT EOT? 755: JRST MTEND1 ;YES. 756: MOVEI ITEM,2B27 ;WRITE COMMAND. 757: MOVE TAC1,[BLKO DC,3400!<MTDC*10>!DCTCHN] 758: MTDMP3: HRLI TAC,PROG ;FOLLOW COMMAND LIST. 759: MOVEM TAC,MTCMDP 760: SKIPN TAC,@TAC 761: JRST MTEND1 ;END OF LIST. 762: JUMPGE TAC,MTDMP3 ;CHANGE OF LIST. 763: HLROM TAC,SVCNTR 764: HRRZS TAC 765: SUB TAC,SVCNTR 766: HLRZ DAT,PROG 767: CAILE TAC,JOBPFI 768: CAMLE TAC,DAT 769: JRST MTDMP2 770: MOVE TAC,@MTCMDP 771: ADDI TAC,(PROG) 772: JRST MTINDC ;GO DO BLKO/BLKI 774: MDRTRY: MOVE TAC,@MTCMDP ;RETRY LAST OPERATION 775: ADDI TAC,(PROG) 776: TLNN IOS,IO ;INPUT? 777: JRST MDRT1 ;YES. 778: MOVE TAC1,[BLKO DC,3400!<MTDC*10>!DCTCHN] 779: MOVEI ITEM,2B27 ;WRITE COMMAND. 780: JRST MTINDC 781: 782: MDRT1: MOVE TAC1,[BLKI DC,4000!<MTDC*10>!DCTCHN] 783: MOVEI ITEM,5B27 ;READ COMMAND 784: JRST MTINDC ;START TAPE AND DISMISS INTERRUPT. 785: BEND